<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8" />
	<title>固定资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->	
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/css/custom.css" rel="stylesheet" type="text/css"/>

	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/select2/select2_metro.css" />
	<link rel="stylesheet" href="${ctx}/assets/plugins/data-tables/DT_bootstrap.css" />
	
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
		.page-content{
			min-height:900px;
		}
	</style>
</head>
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<%@include file="../include/sidebar.jsp" %>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">			
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						物资采购流程
					</h3>
					
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->			
			
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN TAB PORTLET-->   
					<div class="portlet box green tabbable">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-reorder"></i>采购流程待办</div>
						</div>
						<div class="portlet-body">
							<div class=" portlet-tabs">
								<ul class="nav nav-tabs">
									<shiro:hasRole name="固资管理员"><c:if test="${!empty tuiHuoQRList}"><li><a href="#portlet_tab8" data-toggle="tab" id="thqrTab">退货确认</a></li></c:if></shiro:hasRole>
									<%-- <shiro:hasRole name="采买人"> --%><c:if test="${!empty tuiHuoCGList}"><li><a href="#portlet_tab7" data-toggle="tab" id="cgthTab">采购退货</a></li></c:if><%-- </shiro:hasRole> --%>
									<%-- <shiro:hasRole name="采买人"> --%><c:if test="${!empty huanHuoList}"><li><a href="#portlet_tab6" data-toggle="tab" id="cghhTab">采购换货</a></li></c:if><%-- </shiro:hasRole> --%>
									<shiro:hasRole name="财务"><c:if test="${!empty caiGouCWYS}"><li><a href="#portlet_tab9" data-toggle="tab">财务验收</a></li></c:if></shiro:hasRole>
									<shiro:hasRole name="固资管理员"><c:if test="${!empty caiGouRZ}"><li><a href="#portlet_tab5" data-toggle="tab" id="syryysTab">打印单据</a></li></c:if></shiro:hasRole>
									<shiro:hasRole name="固资管理员"><c:if test="${!empty caiGouFF}"><li><a href="#portlet_tab4" data-toggle="tab">采购发放</a></li></c:if></shiro:hasRole>
									<shiro:hasRole name="固资管理员"><c:if test="${!empty yanShouRK}"><li><a href="#portlet_tab3" data-toggle="tab">验收入库</a></li></c:if></shiro:hasRole>
									<%-- <shiro:hasRole name="采买人"> --%><c:if test="${!empty caiGouSP}"><li><a href="#portlet_tab2" data-toggle="tab" id="cgspTab">采购审批</a></li></c:if><%-- </shiro:hasRole> --%>
									<c:if test="${!empty caiGouXZCMR}"><li><a href="#portlet_tab10" data-toggle="tab" id="xzcmrTab">选择采买人</a></li></c:if>
									<shiro:hasRole name="部门负责人"><c:if test="${!empty buMenCGSP}"><li><a href="#portlet_tab1" data-toggle="tab" id="bmspTab">部门采购审批</a></li></c:if></shiro:hasRole>
									<c:if test="${!empty caiGouLingYong}"><li><a href="#portlet_tab0" data-toggle="tab">物资领用</a></li></c:if>
								</ul>
								<div class="tab-content">
									<div class="tab-pane <c:if test="${active==1}">active</c:if>" id="portlet_tab0">
										<div class="portlet-body">
											<form name="caiGouForm" id="wzlyForm" method="POST" action="">
												<c:if test="${!empty caiGouLingYong}">
													<div style="text-align:right;">
														<a class="btn red" id="wzlyPLTH"><i class="fa fa-search"></i>&nbsp;&nbsp;批量退回</a>&nbsp;&nbsp;
														<a class="btn blue" id="wzlyPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量确认</a>
													</div>
												</c:if>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="wzlyAll"></th>
																<th>申请日期</th>
																<th>申请物资描述</th>
																<th>物资名称</th>														
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="wzly">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>								
									<div class="tab-pane <c:if test="${active==2}">active</c:if>" id="portlet_tab1">										
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="caiGouBMSPForm" action="">
												<c:if test="${!empty buMenCGSP}">
													<div style="text-align:right;">
														<a class="btn blue" id="caiGouBMPLTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;&nbsp;
														<a class="btn red" id="caiGouBMPLBTY"><i class="fa fa-edit"></i>&nbsp;&nbsp;批量不同意</a>
													</div>
												</c:if>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="caiGouBMPLAll"></th>
																<th>申请日期</th>
																<th>申请人</th>
																<th>申请物资描述</th>
																<th>申请原因</th>
																<th>查看</th>													
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="bmcgsp">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>								
									<div class="tab-pane" id="portlet_tab2">										
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="cgspForm" action="">
												<div style="text-align:right;">
													<a class="btn blue" id="cgspPLTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;&nbsp;
													<a class="btn red" id="cgspPLBTY"><i class="fa fa-edit"></i>&nbsp;&nbsp;批量不同意</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="cgspAll"></th>
																<th>申请日期</th>														
																<th>申请部门</th>
																<th>申请人</th>
																<th>申请物资描述</th>
																<th>申请原因</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="cgsp">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==3}">active</c:if>" id="portlet_tab10">
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="xzcmrForm" action="">
												<div style="text-align:right;">
													<a class="btn blue" id="xzcmrPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量选择</a>&nbsp;&nbsp;
													<a class="btn red" id="xzcmrPLBTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量拒绝</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="xzcmrPLAll"></th>
																<th>申请日期</th>														
																<th>申请部门</th>
																<th>申请人</th>
																<th>申请物资描述</th>
																<th>申请原因</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="xzcmr">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==4}">active</c:if>" id="portlet_tab3">										
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>
															<th>申请日期</th>														
															<th>申请部门</th>
															<th>申请人</th>
															<th>物资名称</th>
															<th>物资品牌</th>
															<th>规格型号</th>
															<th>查看</th>
															<th>操作</th>
														</tr>
													</thead>
													<tbody id="ysrk">
														<c:forEach items="${yanShouRK }" var="u">
														<tr>
															<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
															<td>${u.dep.depName }</td>			
															<td>${u.user.name }</td>
															<td>${u.wuZi.wuZiMC }</td>
															<td>${u.wuZi.pinPai }</td>
															<td>${u.wuZi.guiGeXH }</td>
															<td><a href="${ctx }/wuzi/shenQingDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>
															</td>
															<td>
																<a href="javascript:daYinTiaoMa('${u.wuZi.id}');" class="btn default btn-xs green-stripe">打印条码</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/caiGouRK.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">验收入库</a>
															</td>
														</tr>
														</c:forEach>													
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==5}">active</c:if>" id="portlet_tab4">										
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>
															<th>申请日期</th>														
															<th>申请部门</th>
															<th>申请人</th>
															<th>物资名称</th>
															<th>物资品牌</th>
															<th>规格型号</th>
															<th>查看</th>
															<th>操作</th>
														</tr>
													</thead>
													<tbody id="cgff">
														<c:forEach items="${caiGouFF }" var="u">
														<tr>
															<td><fmt:formatDate value="${u.shenQingRQ }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
															<td>${u.dep.depName }</td>			
															<td>${u.user.name }</td>
															<td>${u.wuZi.wuZiMC }</td>
															<td>${u.wuZi.pinPai }</td>
															<td>${u.wuZi.guiGeXH }</td>
															<td>
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/shenQingDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>&nbsp;&nbsp;
															</td>
															<td>
																<a href="${ctx }/wuzi/faFang.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">发放</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/caiGouHuanHuo.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">申请换货</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/tuiHuo.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">申请退货</a>
															</td>
														</tr>
														</c:forEach>													
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==6}">active</c:if>" id="portlet_tab5">
										<div class="portlet-body">
											<form method="POST" id="syryysForm" action="">
												<c:if test="${!empty caiGouRZ}">
													<div style="text-align:right;">
														<a class="btn blue" id="pLDY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量打印</a>&nbsp;&nbsp;
														<a class="btn red" id="pLRZ"><i class="fa fa-search"></i>&nbsp;&nbsp;批量确认</a>
													</div>
												</c:if>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="syryysAll"></th>
																<th>申请日期</th>
																<th>申请部门</th>
																<th>申请人</th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>物资品牌</th>
																<th>规格型号</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="syryys">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==7}">active</c:if>" id="portlet_tab9">										
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>
															<th>物资编号</th>														
															<th>物资名称</th>															
															<th>规格型号</th>
															<th>使用部门</th>
															<th>使用人</th>
															<th>物资金额</th>
															<th>查看</th>
															<th>操作</th>
														</tr>
													</thead>
													<tbody id="cwys">
														<c:forEach items="${caiGouCWYS }" var="u">
														<tr>
															<td>${u.wuZi.ziChanBH }</td>
															<td>${u.wuZi.wuZiMC }</td>																
															<td>${u.wuZi.guiGeXH }</td>
															<td>${u.wuZi.dep.depName }</td>
															<td>${u.wuZi.user.name }</td>
															<td>${u.wuZi.wuZiYZ }</td>
															<td>
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/shenQingDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>&nbsp;&nbsp;
															</td>
															<td>
																<a href="${ctx }/wuzi/caiGouCWQR.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">确认</a>
															</td>
														</tr>
														</c:forEach>													
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane" id="portlet_tab6">										
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="cghhForm" action="">
												<div style="text-align:right;">
													<a class="btn red" id="cghhPLBTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量不同意</a>&nbsp;&nbsp;
													<a class="btn blue" id="cghhPLTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="cghhAll"></th>
																<th>申请日期</th>														
																<th>申请部门</th>
																<th>申请人</th>
																<th>物资名称</th>
																<th>物资品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>申请原因</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="cghh">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane" id="portlet_tab7">
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="cgthForm" action="">
												<div style="text-align:right;">
													<a class="btn red" id="cgthPLBTY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量不同意</a>&nbsp;&nbsp;
													<a class="btn blue" id="cgthPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="cgthAll"></th>
																<th>申请日期</th>														
																<th>申请部门</th>
																<th>申请人</th>
																<th>物资名称</th>
																<th>物资品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>申请原因</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="cgth">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==8}">active</c:if>" id="portlet_tab8">
										<div class="portlet-body">
											<form name="caiGouForm" method="POST" id="thqrForm" action="">
												<div style="text-align:right;">
													<a class="btn blue" id="thqrPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量确认</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="thqrAll"></th>
																<th>申请日期</th>														
																<th>申请部门</th>
																<th>申请人</th>
																<th>物资名称</th>
																<th>物资品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>申请原因</th>
																<th>查看</th>
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="thqr">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
								</div>								
							</div>
						</div>
					</div>					
				</div>
			</div>
			<!-- END PAGE CONTAINER-->			
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<shiro:hasRole name="固资管理员">
	<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
		<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
	</object>
	</shiro:hasRole>
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   
	<!--[if lt IE 9]>
	<script src="${ctx}/assets/plugins/respond.min.js"></script>
	<script src="${ctx}/assets/plugins/excanvas.min.js"></script> 
	<![endif]-->   
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="${ctx}/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="${ctx}/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>  
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/scripts/app.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/index.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/tasks.js" type="text/javascript"></script>

	<script type="text/javascript" src="${ctx}/assets/plugins/select2/select2.min.js"></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/scripts/table-advanced.js?t=202004022058"></script>
	<!-- END PAGE LEVEL SCRIPTS -->	
	<script src="${ctx }/lodop/LodopFuncs.js"></script>
	
	<script>
		jQuery(document).ready(function() {
		   App.init(); // initlayout and core plugins
		   //$('#A').addClass("active");
		   //$('#A1').addClass('active');
		   TableAdvanced.init();
		   $.ajax({
				type:"POST",
				url:"${ctx}/wuzi/wzlyList.do",
				dataType:"html",
				async:false,
				success:function(data){
					$('#wzly').html(data);
				}
			});
		   	<c:if test="${active==2}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bmcgspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bmcgsp").html(data);
					}
				});
		   	</c:if>
		   	<c:if test="${active==3}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/xzcmrList.do",
					dataType:"html",
					success:function(data){
						$("#xzcmr").html(data);
					}
				});
		   	</c:if>
		   	<c:if test="${active==6}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/syryysList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$('#syryys').html(data);
					}
				});
		   	</c:if>
		   	<c:if test="${active==8}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/thqrList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$('#thqr').html(data);
					}
				});
		   	</c:if>

            $('#cgspTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/cgspList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#cgsp").html(data);
                    }
                });
            });

            $('#caiGouBMPLTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#caiGouBMSPForm').serialize(),
                    url:"${ctx}/wuzi/buMenCGSPPLTY.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="success"){
                            alert("审批成功！");
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/bmcgspList.do",
                                dataType:"html",
                                success:function(data){
                                    window.document.getElementById("bmcgsp").innerHTML = data;
                                }
                            });
                        }else{
                            alert("未选择审批内容！");
                        }
                    }
                });
            });

            $('#caiGouBMPLBTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#caiGouBMSPForm').serialize(),
                    url:"${ctx}/wuzi/buMenCGSPPLBTY.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#caiGouBMSPForm').attr("action", "${ctx}/wuzi/buMenCGSPPLBTYPage.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#xzcmrTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/xzcmrList.do",
                    dataType:"html",
                    success:function(data){
                        $("#xzcmr").html(data);
                    }
                });
            });

            $('#xzcmrPLAll').click(function(){
                if($('#xzcmrPLAll').attr("checked")){
                    $("input[name='cmrId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='cmrId']:checkbox").prop("checked",false);
                }
            });

            $('#cgspAll').click(function(){
                if($('#cgspAll').attr("checked")){
                    $("input[name='sqId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='sqId']:checkbox").prop("checked",false);
                }
            });

            $('#wzlyAll').click(function(){
                if($('#wzlyAll').attr("checked")){
                    $("input[name='wzlyId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='wzlyId']:checkbox").prop("checked",false);
                }
            });

            $('#xzcmrPL').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#xzcmrForm').serialize(),
                    url:"${ctx}/wuzi/xzcmrPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#xzcmrForm').attr("action", "${ctx}/wuzi/cmrPLZD.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#xzcmrPLBTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#xzcmrForm').serialize(),
                    url:"${ctx}/wuzi/xzcmrPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#xzcmrForm').attr("action", "${ctx}/wuzi/xzcmrPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#cgspPLTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cgspForm').serialize(),
                    url:"${ctx}/wuzi/cgspPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#cgspForm').attr("action", "${ctx}/wuzi/cgspPLTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#cgspPLBTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cgspForm').serialize(),
                    url:"${ctx}/wuzi/cgspPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#cgspForm').attr("action", "${ctx}/wuzi/cgspPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#wzlyPL').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#wzlyForm').serialize(),
                    url:"${ctx}/wuzi/wzlyPLSave.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/wzlyList.do",
                            dataType:"html",
                            async:false,
                            success:function(data){
                                $('#wzly').html(data);
                            }
                        });
                    }
                });
            });

            $('#wzlyPLTH').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#wzlyForm').serialize(),
                    url:"${ctx}/wuzi/wzlyPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#wzlyForm').attr("action", "${ctx}/wuzi/wzlyPLTH.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#syryysTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/syryysList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $('#syryys').html(data);
                    }
                });
            });

            $('#cghhTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/cghhList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $('#cghh').html(data);
                    }
                });
            });

            $('#cghhAll').click(function(){
                if($('#cghhAll').attr("checked")){
                    $("input[name='hhId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='hhId']:checkbox").prop("checked",false);
                }
            });

            $('#cghhPLTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cghhForm').serialize(),
                    url:"${ctx}/wuzi/cghhPLTY.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/cghhList.do",
                            dataType:"html",
                            async:false,
                            success:function(data){
                                $('#cghh').html(data);
                            }
                        });
                    }
                });
            });

            $('#cghhPLBTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cghhForm').serialize(),
                    url:"${ctx}/wuzi/cghhPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#cghhForm').attr("action", "${ctx}/wuzi/cghhPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#cgthTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/cgthList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $('#cgth').html(data);
                    }
                });
            });

            $('#cgthAll').click(function(){
                if($('#cgthAll').attr("checked")){
                    $("input[name='thId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='thId']:checkbox").prop("checked",false);
                }
            });

            $('#cgthPL').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cgthForm').serialize(),
                    url:"${ctx}/wuzi/cgthPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/cgthList.do",
                            dataType:"html",
                            async:false,
                            success:function(data){
                                $('#cgth').html(data);
                            }
                        });
                    }
                });
            });

            $('#cgthPLBTY').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#cgthForm').serialize(),
                    url:"${ctx}/wuzi/cgthPLCX.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#cgthForm').attr("action", "${ctx}/wuzi/cgthPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#thqrTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/thqrList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $('#thqr').html(data);
                    }
                });
            });

            $('#thqrAll').click(function(){
                if($('#thqrAll').attr("checked")){
                    $("input[name='thqrId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='thqrId']:checkbox").prop("checked",false);
                }
            });

            $('#thqrPL').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#thqrForm').serialize(),
                    url:"${ctx}/wuzi/thqrPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/thqrList.do",
                            dataType:"html",
                            async:false,
                            success:function(data){
                                $('#thqr').html(data);
                            }
                        });
                    }
                });
            });

            $('#syryysAll').click(function(){
                if($('#syryysAll').attr("checked")){
                    $("input[name='ysId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='ysId']:checkbox").prop("checked",false);
                }
            });

            $('#pLRZ').bind("click",function(){
                $.ajax({
                    type:"POST",
                    data:$('#syryysForm').serialize(),
                    url:"${ctx}/wuzi/syryysPLRZ.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择确认内容！");
                        }else{
                            alert("等待财务人员确认！");
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/syryysList.do",
                                dataType:"html",
                                success:function(data){
                                    $('#syryys').html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#caiGouBMPLAll').click(function(){
                if($('#caiGouBMPLAll').attr("checked")){
                    $("input[name='bmsqId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='bmsqId']:checkbox").prop("checked",false);
                }
            });

            $('#bmspTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/bmcgspList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#bmcgsp").html(data);
                    }
                });
            });

            setActiveTab();
		});
		
		var BMcaigoushenqing=function(id){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/buMenCGSP.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						window.location.reload();		
					}
				}
			});
		}
		
		var caiGouJieShou=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/caiGouJieShou.do",
				dataType:"json",
				async:false,
				success:function(data){
					alert("物资已接收");
					window.location.reload();
				}
			});
		}
		
		var caiGouHuanHuoTY=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/caiGouHuanHuoTY.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("您选择同意换货");
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/cghhList.do",
							dataType:"html",
							success:function(data){
								$('#cghh').html(data);
							}
						});
					}else{
						alert("审批不成功");
					}
				}
			});
		}
		
		var caiGouTuiHuoTY=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/caiGouTuiHuoTY.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("您选择同意退货");
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/cgthList.do",
							dataType:"html",
							success:function(data){
								$('#cgth').html(data);
							}
						});				
					}else{
						alert("审批不成功");
					}
				}
			});
		}
		
		<shiro:hasRole name="固资管理员">
		var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
		
		var daYinTiaoMa=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/getZiChanBH.do",
				dataType:"json",
				async:false,
				success:function(data){
					LODOP=getLodop();
					LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_打印条码");
					LODOP.SET_PRINT_PAGESIZE (1,"60mm","40mm","");
					LODOP.ADD_PRINT_BARCODE("5mm","5mm","90%","80%","128A",data.result);		
					LODOP.PREVIEW();
				}
			});
		}
		
		function daYinDanJu(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/caiGouDaYinHTML.do",
				dataType:"html",
				async:false,
				success:function(data){
					LODOP=getLodop();  
					LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_预览打印表格");
					LODOP.SET_PRINT_PAGESIZE(2, 0, 0,"A4");
					LODOP.ADD_PRINT_HTM("10mm","30mm","250mm","400mm",data);
					LODOP.PREVIEW();
				}
			});
		}
		
		$('#pLDY').bind("click",function(){
			$.ajax({
				type:"POST",
				data:$('#syryysForm').serialize(),
				url:"${ctx}/wuzi/syryysPLDY.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="none"){
						alert("未选择打印内容！");
					}else{
						var ysIds=data.result;
						var ysId=ysIds.split(",");
						LODOP=getLodop();  
						LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_预览打印表格");
						LODOP.SET_PRINT_PAGESIZE (2, 0, 0,"A4");
						for(var i=0;i<ysId.length;i++){
							$.ajax({
								type:"POST",
								data:{
									id:ysId[i]
								},
								url:"${ctx}/wuzi/caiGouDaYinHTML.do",
								dataType:"html",
								async:false,
								success:function(data){
									LODOP.ADD_PRINT_HTM("10mm","30mm","250mm","400mm",data);
									if(i<ysId.length-1)
										LODOP.NewPage();
								}
							});
						}
						LODOP.PREVIEW();
					}
				}
			});
		});
		</shiro:hasRole>
		
		var caiGouRZ=function(id){			
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/caiGouRZ.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("等待财务人员确认！");
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/syryysList.do",
							dataType:"html",
							success:function(data){
								$('#syryys').html(data);
							}
						});
					}
				}
			});
		}	
			
		var tuiHuoQR=function(id){			
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/tuiHuoQR.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("您已确认退货");
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/thqrList.do",
							dataType:"html",
							success:function(data){
								$('#thqr').html(data);
							}
						});
					}else{
						alert("审批不成功");
					}
				}
			});
		}
		

		
		function buMenCaiGouTY(id){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/buMenCaiGouTY.do",
				data:{
					"id":id
				},
				dataType:"json",
				async:false,
				success:function(data){
					alert("审批完成！");
					$.ajax({
						type:"POST",
						url:"${ctx}/wuzi/bmcgspList.do",
						dataType:"html",
						async:false,
						success:function(data){
							$("#bmcgsp").html(data);
						}
					});
				}
			});
		}

        function setActiveTab() {
            var activeTab = $('.nav-tabs').find('li:first');
            activeTab.find('a').trigger('click');
            activeTab.addClass('active');
        }


	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>